package validators

import (
	"github.com/go-playground/validator/v10"
	"time"
)

// ValidateAfterDate 判断时间是否是当前时间之后
func ValidateAfterDate(fl validator.FieldLevel) bool {
	date, err := time.ParseInLocation("2006-01-02", fl.Field().String(), time.Local)
	if err != nil {
		return false
	}
	if date.Before(time.Now()) {
		return false
	}
	return true
}
